import { getToken } from '@/utils/auth'

const defaultSettings = require('../../settings.js')
export default (_self) => {

    return {
        // editBtn:false,
        // delBtn:false,
        index: true,
        indexLabel: '序号',
        align: 'center',
        headerAlign: 'center',
        border: true,
        dialogWidth: '50%',
        labelWidth: 140,
        stripe: false,
        searchMenuSpan: 4,
        props: {
            label: 'label',
            value: 'value'
        },
        column: [{
                width: 120,
                label: "视频名称",
                prop: "name",
                span: 12,
                rules: [{
                    required: true,
                    message: "请输入视频名称",
                    trigger: "blur"
                }]
            },
            // {
            //     width: 120,
            //     data: {
            //         key: getToken()
            //     },

            //     label: '封面图',
            //     prop: 'img',
            //     type: 'upload',
            //     listType: 'picture-img',
            //     span: 24,
            //     propsHttp: {

            //         res: 'datas'
            //     },
            //     action: defaultSettings.uploadImg
            // },
            {

                data: {
                    key: getToken()
                },
                slot: true,
                accept: "video/mp4",
                label: '视频',

                prop: 'url',
                type: 'upload',
                listType: 'picture-img',
                span: 24,
                propsHttp: {

                    res: 'datas',
                    url:'url'
                },
                action: defaultSettings.uploadFile
            },
            {
                width: 180,
                sortable: true,
                label: "新增时间",
                prop: "add_time",
                row: true,
                span: 12,
                display: false,
                type: 'datetime',
                searchSpan: 12,
                searchRange: true,
                searchSpan: 6,
                search: true,
            },
            {
                width: 180,
                sortable: true,
                label: "修改时间",
                prop: "update_time",
                row: true,
                span: 12,
                display: false,
                type: 'datetime',
                searchSpan: 12,
                searchRange: true,
                searchSpan: 6,
                // search: true,
            },



            // {
            //     label: "简介",
            //     prop: "info",
            //     span: 12,
            //     rules: [{
            //         required: true,
            //         message: "请输入简介",
            //         trigger: "blur"
            //     }]
            // },

            {
                width: 80,

                span: 12,
                label: "状态",
                prop: "state",
                // search: true,
                type: 'select',
                slot: true,
                dicData: [{
                        label: '禁用',
                        value: 2
                    },
                    {
                        label: '启用',
                        value: 1
                    }
                ],
                rules: [{
                    required: true,
                    message: '请选择状态',
                    trigger: 'change'
                }],
            },
        ],
    }
}